#include<iostream>
#include<map>
using namespace std;
const int N = 1e9;
int n;
map<int, int>mp;
int find(int x)
{
	int l = 0;
	int r = mp.size() + 1;
	while (l + 1 < r) {
		int mid = l + r >> 1;
		if (mp[mid] <= x)l = mid;
		else r = mid;
	}
	return r;
}
int main()
{
	cin >> n;
	int cnt = 0;
	int ans = 0;
	for (int i = 1;; i++) {
		cnt++;
		ans += i;
		if (ans > n)break;
		mp[ans] = 1;
	}
	for (int i = 1; i * i <= n; i++) {
		int x = i;
		int y = n - i;
		int idx = find(y);
		if (idx >= 1 && idx <= mp.size()) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}
